var time_variable;
 
function getXMLObject()  //XML OBJECT
{
    var xmlHttp = false;
    try {
        xmlHttp = new ActiveXObject("Msxml2.XMLHTTP") ; // For Old Microsoft Browsers
    }
    catch (e) {
        try {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");  // For Microsoft IE 6.0+
        }
        catch (e2) {
            xmlHttp = false;   // No Browser accepts the XMLHTTP Object then false
        }
    }
    if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
        xmlHttp = new XMLHttpRequest();        //For Mozilla, Opera Browsers
    }
    return xmlHttp;  // Mandatory Statement returning the ajax object created
}

function ajaxFunction(Requrl,data,method) {
    var xmlhttp = new getXMLObject();	//xmlhttp holds the ajax object
	
    if(xmlhttp) {
        if (method == 'POST') {
            xmlhttp.open(method, Requrl, false); //calling testing.php using POST method
            xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
            xmlhttp.send(data); //Posting txtname to PHP File
        }
        else{
            xmlhttp.open(method+"?json="+data, Requrl, false); //calling testing.php using POST method
            xmlhttp.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
            xmlhttp.send(); //Posting txtname to PHP File
        }   
    }
    if(xmlhttp.readyState==4 && xmlhttp.status==200){
        return xmlhttp;
    }
    else {
}
}
 //xmlhttp.responseText;